<template>
  <el-dialog :title=title
             :visible.sync="dialogVisible"
              @close="handleClose">
    <slot name="content">
    </slot>
    <span slot="footer" class="dialog-footer">
    <el-button @click="">取 消</el-button>
    <el-button type="primary" @click="">确 定</el-button>
  </span>
  </el-dialog>
</template>

<script>
export default {
  name: "MyElDialog",
  props: {
    show: {
      type: Boolean,
    },
    title: {
      type: String,
    }
  },
  data() {
    return {
      dialogVisible: this.show,
    }
  },

  // watch: {
  //   show(newVal) {
  //     this.dialogVisible = newVal;
  //   }
  // },

  methods: {
    handleClose() {
      this.dialogVisible = false;
      this.$emit('close-dlg')
    },

    updateVisible(state) {
      this.dialogVisible = state;
    }

  }

}
</script>

<style scoped>

</style>